# Contributor: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
# Maintainer: Krystian Chachuła <krystian@krystianch.com>
pkgname=v4l2loopback-src
_modname=v4l2loopback
pkgver=0.12.7
pkgrel=1
pkgdesc="Kernel module to create V4L2 loopback devices"
url="https://github.com/umlaeute/v4l2loopback"
arch="noarch"
license="GPL-2.0-only"
depends="akms"
source="$pkgname-$pkgver.tar.gz::https://github.com/umlaeute/v4l2loopback/archive/v$pkgver.tar.gz"
builddir="$srcdir/v4l2loopback-$pkgver"
options="!check"  # sources only

prepare() {
	default_prepare

	cat >AKMBUILD <<-EOF
	modname=$_modname
	modver=$pkgver-r$pkgrel
	built_modules='v4l2loopback.ko'
	EOF
}

package() {
	install -D -m644 -t "$pkgdir"/usr/src/$_modname-$pkgver \
		./*.c ./*.h Makefile AKMBUILD
}

sha512sums="
fcfe55396e9ddad56e592ffccd955c8ceff49c11cfbc5af382123ee0c15b41729b78cb763acbb17d288c48498f2183a4b24f146758ae67e1982b7ab2b07ff973  v4l2loopback-src-0.12.7.tar.gz
"
